package com.graduation.mybatis.bean;

import lombok.Data;

import java.time.LocalDateTime;

@Data
public class DietRecordVO {

    private Integer recordId;
    private Integer foodEntryId;
    private Integer foodId;
    private String foodName;
    private Double grams;
    private String image;

    private Double calories;
    private Double protein;
    private Double fat;
    private Double carbohydrate;

    private Integer mealType;
    private LocalDateTime recordTime;

    // 计算实际营养值的方法
    public Double getActualCalories() {
        return grams * calories / 100;
    }

    public Double getActualProtein() {
        return grams * protein / 100;
    }

    public Double getActualFat() {
        return grams * fat / 100;
    }

    public Double getActualCarbohydrate() {
        return grams * carbohydrate / 100;
    }

}